//
// DepRepoParams
//
// Copyright (C) jextra.net.
//
//  This file is part of the net.jextra.dep Library.
//
//  The net.jextra.dep Library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//
//  The net.jextra.dep Library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with the net.jextra.dep Library; if not, write to the Free
//  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
//  02111-1307 USA.
//

package net.jextra.dep.repo;

import java.util.*;

/**
 * <p>
 * This is a Node that most likely represents an XML tag Node. It is used to pass configuration
 * data into a {@link DepRepo}s <pre>init</pre> method generically. The nodes and children are
 * specific to the store type.
 * </p>
 */
public class DepRepoParam
{
    // ============================================================
    // Fields
    // ============================================================

    private String tag;
    private HashMap<String,String> attributes;
    private List<DepRepoParam> children;

    // ============================================================
    // Constructors
    // ============================================================

    public DepRepoParam( String tag )
    {
        this.tag = tag;
        attributes = new HashMap<String,String>();
        children = new ArrayList<DepRepoParam>();
    }

    // ============================================================
    // Methods
    // ============================================================

    // ----------
    // public
    // ----------

    public String getTag()
    {
        return tag;
    }

    public void addAttribute( String key, String value )
    {
        attributes.put( key, value );
    }

    public String getAttribute( String key )
    {
        return attributes.get( key );
    }

    public Map<String,String> getAttributes()
    {
        return attributes;
    }

    public void addChild( DepRepoParam child )
    {
        children.add( child );
    }
}

